from connectpeople.polls.models import Poll
from django.contrib import admin
from connectpeople.polls.models import Choice

class ChoiceInline(admin.TabularInline):
    model = Choice
    extra = 3


class PollAdmin(admin.ModelAdmin):
    #fieldsets = [
    #    (None,               {'fields': ['poll_topic']}),
    #    ('Date information', {'fields': ['pub_date'], 'classes' : ['collapse']}),
    #]
    inlines = [ChoiceInline]
    list_display = ('poll_topic', 'pub_date', 'was_published_today')
    list_filter = ['pub_date']
    search_fields = ['poll_topic']
    date_hierarchy = 'pub_date'

admin.site.register(Poll, PollAdmin)

